$(document).ready(function() {

showScroll();

function showScroll() {
    $(window).scroll(function() {
        var scrollValue = $(window).scrollTop();
        scrollValue > 100 ? $('li[class=back]').fadeIn() : $('li[class=back]').fadeOut();
        scrollValue > 100 ? $('#page-footer-gt').addClass('five') : $('#page-footer-gt').removeClass('five');
    });
    $('#back').click(function() {
        $("html,body").animate({ scrollTop: 0 }, 200);
    });
}

    bfb_5_2 = 2 / 5;
    $('.img_5_2').each(function() {
        var imgW = $(this).width();
        var imgH = imgW * bfb_5_2;
        $(this).height(imgH);
    });

    bfb_4_3 = 3 / 4;
    $('.img_4_3').each(function() {
        var imgW = $(this).width();
        var imgH = imgW * bfb_4_3;
        $(this).height(imgH);
    });

    bfb_1_1 = 1 / 1;
    $('.img_1_1').each(function() {
        var imgW = $(this).width();
        var imgH = imgW * bfb_1_1;
        $(this).height(imgH);
    });

    bfb_3_4 = 4 / 3;
    $('.img2').each(function() {
        var imgW = $(this).width();
        var imgH = imgW * bfb_3_4;
        $(this).height(imgH);
    });



    $(window).resize(function() {
        $('.img_5_2').each(function() {
            var imgW = $(this).width();
            var imgH = imgW * bfb_5_2;
            $(this).height(imgH);
        });

        $('.img_4_3').each(function() {
            var imgW = $(this).width();
            var imgH = imgW * bfb_4_3;
            $(this).height(imgH);
        });
        $('.img_1_1').each(function() {
            var imgW = $(this).width();
            var imgH = imgW * bfb_1_1;
            $(this).height(imgH);
        });
        $('.img_3_4').each(function() {
            var imgW = $(this).width();
            var imgH = imgW * bfb_3_4;
            $(this).height(imgH);
        });
    });


});